package com.openlogic.system.service.impl;

import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Component;

import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.solon.service.impl.ServiceImpl;
import com.openlogic.common.core.enums.DictEnum;
import com.openlogic.common.security.entity.SysTenantEntity;
import com.openlogic.common.security.entity.table.Tables;
import com.openlogic.system.mapper.SysTenantMapper;
import com.openlogic.system.service.ISysTenantService;

/**
 * @ClassName: SysTenantServiceImpl
 * @Description: 企业 租户服务层
 * @author weiyongpeng
 * @date 2025年1月31日 下午3:04:03
 */
@Component
public class SysTenantServiceImpl extends ServiceImpl<SysTenantMapper, SysTenantEntity> implements ISysTenantService {

	@Inject
	SysTenantMapper sysTenantMapper;
	
	@Override
	public SysTenantEntity selectEnterpriseByName(String enterpriseName) {
		return sysTenantMapper.selectOneByQuery(QueryWrapper.create().where(Tables.sysTenant.name.eq(enterpriseName)
				.and(Tables.sysTenant.status.eq(DictEnum.COMMON_STATUS.OK.getValue()))));
	}

	
}
